<script>
    function want_to(att) {
        //document.getElementById('CustomerDataDemand').value = att.value;
    }
</script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#CustomerForm").formToWizard({submitButton: 'SaveAccount'});
    });
</script>
<style>
    .container {
        width: 950px;
    }
    fieldset { border:none;}
    legend { 
        font-family: 'Segoe UI Semibold_', 'Open Sans Bold', Verdana, Arial, Helvetica, sans-serif;
        font-weight: bold;
        color: #00A652 ;
        font-size: 1.6rem;
        letter-spacing: 0.02em;
        text-transform:uppercase;
    }

    label { display:block; margin:15px 0 5px;}
    .prev, .next { 
        padding: 4px 30px;
        text-align: center;
        vertical-align: middle !important;
        border: 1px transparent solid;
        border-radius: 0;
        cursor: pointer;
        display: inline-block;
        outline: none;
        font-family: 'Segoe UI Light_', 'Open Sans Light', Verdana, Arial, Helvetica, sans-serif;
        font-size: 14px;
        line-height: 16px;
        margin: auto;

        background-color:#212121; 
        padding:3px 20px; 
        color:#fff; 
        text-decoration:none;
    }
    .prev:hover, .next:hover { background-color:#757575; text-decoration:none;color:#fff;}
    .prev { float:left;}
    .next { float:right;}
    #steps { list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;}
    #steps li {font-size:24px; float:left; padding:10px; color:#b0b1b3;}
    #steps li span {font-size:11px; display:block;}
    #steps li.current { color:#000;}
    #makeWizard { background-color:#b0232a; color:#fff; padding:5px 10px; text-decoration:none; font-size:18px;}
    #makeWizard:hover { background-color:#000;}
</style>

<div class="row">
    <h3 class="widget-title"><?php echo __d($local, 'WANT TO BUY/SELL/RENT'); ?></h3>
    <?php
    echo $this->Form->create('Customer', array(
        'novalidate' => true,
        'inputDefaults' => array(
            'error' => false
        ),
        'id' => 'CustomerForm'
    ));
    ?>
    <div class="row no-margin">
        <div class="span12">
            <fieldset>
                <legend>What do you want</legend>
                <table width="100%" class="text-center">
                    <tr>
                        <td colspan="2">
                            <?php echo $this->Form->error('CustomerData.demand'); ?>
                            <div class="input-control radio default-style margin-rigth" data-role="input-control">
                                <?php echo $this->Form->hidden('CustomerData.demand'); ?>
                                <label>
                                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandBuy" value="Buy" onclick="want_to(this);" />
                                    <span class="check"></span>
                                    Want to Buy
                                </label>
                            </div>
                            <div class="input-control radio default-style margin10" data-role="input-control">
                                <label>
                                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandSell" value="Sell" onclick="want_to(this);"/>
                                    <span class="check"></span>
                                    Want to Sell
                                </label>
                            </div>
                            <div class="input-control radio default-style margin10" data-role="input-control">
                                <label>
                                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandRent" value="Rent" onclick="want_to(this);"/>
                                    <span class="check"></span>
                                    Want to Rent
                                </label>
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>

            <fieldset>
                <legend>Residential/Commercial</legend>
                <table width="100%">                
                    <tr>
                        <td valign="top" width="50%">
                            <h5 class="uppercase"><?php echo $properties[0]['Property']['name'] ?></h5>
                            <div class="span12">
                                <?php foreach ($properties[0]['PropertyType'] as $a): ?>
                                    <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                        <label>
                                            <input type="radio" name="data[CustomerData][property_type_id]" id="CustomerDataPropertyTypeId<?php echo h($a['id']) ?>" value="<?php echo h($a['id']) ?>" onclick=""/>
                                            <span class="check"></span>
                                            <?php echo h($a['type_name']) ?>
                                        </label>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </td>
                        <td valign="top">
                            <h5 class="uppercase"><?php echo $properties[1]['Property']['name'] ?></h5>
                            <div class="span12">
                                <?php foreach ($properties[1]['PropertyType'] as $a): ?>
                                    <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                        <label>
                                            <input type="radio" name="data[CustomerData][property_type_id]" id="CustomerDataPropertyTypeId<?php echo h($a['id']) ?>" value="<?php echo h($a['id']) ?>" onclick=""/>
                                            <span class="check"></span>
                                            <?php echo h($a['type_name']) ?>
                                        </label>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </td>
                        
                    </tr>   
                </table>
            </fieldset>

            <fieldset>
                <legend>Select property</legend>
                <table width="100%">
                    <tr>
                        <td valign="top">
                            <h5 class="uppercase">Preference</h5>
                            <div class="span12">
                                <?php foreach ($preferences as $a): ?>
                                    <div data-role="input-control" class="input-control checkbox margin-left">
                                        <label>
                                            <input type="checkbox">
                                            <span class="check"></span>
                                            <?php echo h($a) ?>
                                        </label>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <h5 class="uppercase">Bedroom</h5>
                            <?php foreach ($bedRooms as $a): ?>
                                <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                    <label>
                                        <input type="radio" name="bedroom" value="<?php echo h($a) ?>"/>
                                        <span class="check"></span>
                                        <?php echo h($a) ?>
                                    </label>
                                </div>
                            <?php endforeach; ?>
                        </td>

                    </tr>  
                    <tr>
                        <td valign="top" width="33%">
                            <h5 class="uppercase">Location</h5>
                            <?php foreach ($locations as $a): ?>
                                <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                    <label>
                                        <input type="radio" name="location" value="<?php echo h($a) ?>"/>
                                        <span class="check"></span>
                                        <?php echo h($a) ?>
                                    </label>
                                </div>
                            <?php endforeach; ?>
                        </td>   
                    </tr>  
                    <tr>
                        <td valign="top">
                            <h5 class="uppercase">Price Range</h5>
                            <?php echo $this->Form->error('Customer.price_start'); ?>
                            <div class="input-control text no-margin size3" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.price_start', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                            TO
                            <?php echo $this->Form->error('Customer.price_end'); ?>
                            <div class="input-control text no-margin size3" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.price_end', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>   
                    </tr>  
                </table>
            </fieldset>

            <fieldset>
                <legend>Contact information</legend>
                <table width="100%">
                    <tr>
                        <td align="left"><?php echo __d($local, 'first_name'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.first_name'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.first_name', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>

                        </td>
                        <td align="right"><?php echo __d($local, 'last_name'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.last_name'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.last_name', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td><?php echo __d($local, 'email'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.email'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.email', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>
                        <td align="right"><?php echo __d($local, 'tel'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.tel'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.tel', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td><?php echo __d($local, 'mobile'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.mobile'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.mobile', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>
                        <td align="right"><?php echo __d($local, 'fax'); ?></td>
                        <td>
                            <?php echo $this->Form->error('Customer.fax'); ?>
                            <div class="input-control text no-margin" data-role="input-control">
                                <?php
                                echo $this->Form->input('Customer.fax', array(
                                    'label' => false,
                                    'maxlength' => '100'
                                ));
                                ?>
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>
            <p>
            <div class="span12 text-center">
                <?php echo $this->Form->submit(__d($local, 'SEND'), array('class' => 'button success', 'id' => 'SaveAccount')); ?>
            </div>
            </p>

        </div>
    </div>
    <?php echo $this->Form->end(); ?> 
</div>